package com.robot.base.common.api;

import com.qihang.annotations.ApiFactory;
import com.robot.base.model.BaseResponse;
import com.robot.base.model.CollectDetailBean;
import com.robot.base.model.CourseAllTypeBean;
import com.robot.base.model.MemberAdapterBean;
import com.robot.base.model.PageListBean;
import com.robot.base.model.ProjectBean;
import com.robot.base.model.TagListBean;
import com.robot.base.model.TeamListBean;
import com.robot.base.model.TypeBean;
import com.robot.base.model.UserInfoBean;
import com.robot.base.model.WorkCommentBean;
import com.robot.base.model.WorksBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

@ApiFactory(value = GlBaseApi.class)
public interface WorkService {

    @GET("/app-api/app/consts/listTeam")
    Observable<BaseResponse<List<TeamListBean>>> listTeam();

    @GET("/app-api/app/consts/getCustomerItemInfo")
    Observable<BaseResponse<PageListBean<ProjectBean>>> getCustomerItemInfo(@QueryMap Map<String, Object> map);

    @GET("/app-api/app/consts/get")
    Observable<BaseResponse<ProjectBean>> get(@Query("id") String id);

    @GET("/app-api/app/consts/getTeamByItemAccount")
    Observable<BaseResponse<List<MemberAdapterBean>>> getTeamByItemAccount();

    @GET("/app-api/app/consts/listLabel")
    Observable<BaseResponse<List<TagListBean>>> listLabel();

    @GET("/app-api/app/infra/dict/getDictType")
    Observable<BaseResponse<List<TypeBean>>> getDictType(@Query("type") String type);

    @GET("/app-api/app/consts/getLabelById")
    Observable<BaseResponse<TagListBean>> getLabelById(@Query("id") String id);

    @GET("/app-api/app/consts/getTeamById")
    Observable<BaseResponse<TeamListBean>> getTeamById(@Query("id") String id);

    @POST("/app-api/app/consts/createTeam")
    Observable<BaseResponse<String>> createTeam(@Body Map<String, Object> map);

    @POST("/app-api/app/consts/item-info-account/create")
    Observable<BaseResponse<String>> createProjectAccount(@Body Map<String, Object> map);

    @DELETE("/app-api/app/consts/item-info-account/delete")
    Observable<BaseResponse<String>> deleteProjectAccount(@Query("id") String id);

    @PUT("/app-api/app/consts/updateItemInfo")
    Observable<BaseResponse<String>> updateItemInfo(@Body ProjectBean params);

    @PUT("/app-api/app/consts/updateStatus")
    Observable<BaseResponse<String>> updateStatus(@Body Map<String, Object> map);

    @POST("/app-api/app/consts/updateTeam")
    Observable<BaseResponse<String>> updateTeam(@Body Map<String, Object> map);

    @GET("/app-api/app/account/users/getOtherUsers")
    Observable<BaseResponse<List<UserInfoBean>>> getOtherUsers(@Query("keyword") String id);

    @POST("/app-api/app/consts/createAccount")
    Observable<BaseResponse<String>> createAccount(@Body Map<String, Object> map);

    @POST("/app-api/app/consts/createLabel")
    Observable<BaseResponse<String>> createLabel(@Body Map<String, Object> map);

    @DELETE("/app-api/app/consts/deletesLabel")
    Observable<BaseResponse<String>> deletesLabel(@Query("id") String id);

    @POST("/app-api/app/consts/updateLabel")
    Observable<BaseResponse<String>> updateLabel(@Body Map<String, Object> map);

    Observable<BaseResponse<WorksBean>> getWorkDetail(@Query("id") String id);

    @GET("/app-api/app/works/allType")
    Observable<BaseResponse<List<CourseAllTypeBean>>> allType();

    @GET("/app-api/app/works/page")
    Observable<BaseResponse<PageListBean<WorksBean>>> page(@QueryMap Map<String, Object> map);

    //新增作品接口
    @POST("/app-api/app/works/createWorks")
    Observable<BaseResponse<String>> createWorks(@Body Map<String, Object> map);

    //创建收藏夹
    @POST("/app-api/app/works/createCollect")
    Observable<BaseResponse<String>> createCollect(@Body Map<String, Object> map);

    //关注收藏夹作品
    @POST("/app-api/app/works/followCollect")
    Observable<BaseResponse<String>> followCollect(@Body Map<String, Object> map);

    //获得收藏夹信息
    @GET("/app-api/app/works/getCollectDetail")
    Observable<BaseResponse<CollectDetailBean>> getCollectDetail(@Query("id") String id);

    //分页获取收藏夹列表
    @GET("/app-api/app/works/collect-page")
    Observable<BaseResponse<PageListBean<CollectDetailBean>>> collectPage(@QueryMap Map<String, Object> map);

    //添加收藏夹作品
    @POST("/app-api/app/works/saveCollectWorks")
    Observable<BaseResponse<String>> saveCollectWorks(@Body Map<String, Object> map);

    //热门收藏夹
    @POST("/app-api/app/works/hotCollect")
    Observable<BaseResponse<List<CollectDetailBean>>> hotCollect(@Body Map<String, Object> map);

    //点赞或分享作品接口
    @POST("/app-api/app/works/likeWork")
    Observable<BaseResponse<String>> likeWork(@Body Map<String, Object> map);

    //获取作品评价接口
    @GET("/app-api/app/works/getWorkComment")
    Observable<BaseResponse<List<WorkCommentBean>>> getWorkComment(@Query("id") String id);

    //评价作品
    @POST("/app-api/app/works/createWorkComment")
    Observable<BaseResponse<String>> createWorkComment(@Body Map<String, Object> map);

    //分页获取作品评价
    @GET("/app-api/app/works/pageComment")
    Observable<BaseResponse<PageListBean<WorkCommentBean>>> pageComment(@QueryMap Map<String, Object> map);
}
